package org.minproject.my_library_back.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 
 * @TableName library
 */
@TableName(value ="library")
@Data
public class Library implements Serializable {
    /**
     * 
     */
    @TableId
    private String libraryName;

    /**
     * 
     */
    private String libraryAuthor;

    /**
     * 
     */
    private String libraryInformation;

    /**
     * 
     */
    private String libraryPicture;

    /**
     * 
     */
    private Integer libraryNum;

    /**
     * 
     */
    private BigDecimal libraryPrice;

    /**
     * 
     */
    private Integer userId;

    /**
     * 
     */
    private String userName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Library other = (Library) that;
        return (this.getLibraryName() == null ? other.getLibraryName() == null : this.getLibraryName().equals(other.getLibraryName()))
            && (this.getLibraryAuthor() == null ? other.getLibraryAuthor() == null : this.getLibraryAuthor().equals(other.getLibraryAuthor()))
            && (this.getLibraryInformation() == null ? other.getLibraryInformation() == null : this.getLibraryInformation().equals(other.getLibraryInformation()))
            && (this.getLibraryPicture() == null ? other.getLibraryPicture() == null : this.getLibraryPicture().equals(other.getLibraryPicture()))
            && (this.getLibraryNum() == null ? other.getLibraryNum() == null : this.getLibraryNum().equals(other.getLibraryNum()))
            && (this.getLibraryPrice() == null ? other.getLibraryPrice() == null : this.getLibraryPrice().equals(other.getLibraryPrice()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLibraryName() == null) ? 0 : getLibraryName().hashCode());
        result = prime * result + ((getLibraryAuthor() == null) ? 0 : getLibraryAuthor().hashCode());
        result = prime * result + ((getLibraryInformation() == null) ? 0 : getLibraryInformation().hashCode());
        result = prime * result + ((getLibraryPicture() == null) ? 0 : getLibraryPicture().hashCode());
        result = prime * result + ((getLibraryNum() == null) ? 0 : getLibraryNum().hashCode());
        result = prime * result + ((getLibraryPrice() == null) ? 0 : getLibraryPrice().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", libraryName=").append(libraryName);
        sb.append(", libraryAuthor=").append(libraryAuthor);
        sb.append(", libraryInformation=").append(libraryInformation);
        sb.append(", libraryPicture=").append(libraryPicture);
        sb.append(", libraryNum=").append(libraryNum);
        sb.append(", libraryPrice=").append(libraryPrice);
        sb.append(", userId=").append(userId);
        sb.append(", userName=").append(userName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}